
window.onload=function(){
	
	var music =document.querySelector(".music")
	console.log(music)
	var audio =document.querySelector("audio")	
	
// tab 切换
var ulBox =document.querySelector(".zhuye-bt")
var ulBox1=document.querySelector(".ulbox")
var zhuye = document.querySelector(".zhuye-foot")
var a1 =document.querySelector(".a1")
    // console.log(liBox01)
    var a2 =document.querySelector(".a2")
    var  box = document.querySelector(".zhuye-hk")
    var boxWidth = box.offsetWidth;
    var ulBoxWidth =ulBox1.offsetWidth;
    // box.style.left =boxWidth + "px";
    console.log(boxWidth)
    window.addEventListener("resize", function () {
    	boxWidth = box.offsetWidth;
        ulBoxWidth =ulBox1.offsetWidth;
    	// box.style.left =boxWidth + "px";
    	console.log(boxWidth)
    	box.style.transition = "none";
        zhuye.style.transition ="none"

    })
    FastClick.attach(document.body);
    a2.addEventListener("click", function () {
    	console.log(123333)
    	box.style.left = boxWidth + "px";
    	box.style.transition = "left 0.5s";
        zhuye.style.left = -ulBoxWidth + "px";
        zhuye.style.transition = "left 0.5s";



    });
    a1.addEventListener("click", function () {
    	box.style.left = 0 + "px";
    	box.style.transition = "left 0.5s";
         zhuye.style.left = 0 + "px";
        zhuye.style.transition = "left 0.5s";
    });
// 音乐播放
music.addEventListener("click",function(){
	console.log(123333)
	if(this.classList.contains('show')){
		this.classList.remove('show') ;
		this.classList.add('hide')     
		audio.pause();              
	}else{
		this.classList.add('show');
		this.classList.remove('hide')
		audio.play()                            
	}

})
}
